package cn.acmenms.po.model;

import cn.acmenms.po.serializ.CustomDateSerializer;
import cn.acmenms.po.serializ.FriendlyDateSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.time.LocalDateTime;

/**
 * @ClassName: DaySignInfo
 * @Description: 签到类
 * @author: 神奇的鸭鸭
 * @Date: 2018/2/9 23:23
 */
public class SignIn {

    private Integer userId; // 用户ID

    @JsonSerialize(using = CustomDateSerializer.class)
    private LocalDateTime signDate; // 签到日期

    @JsonSerialize(using = FriendlyDateSerializer.class)
    private LocalDateTime signTime; // 签到时间——友好时间

    private String sourceFrom; // 客户端来源

    private String userName; // 用户名

    private String userIcon; // 用户头像

    // 连续签到
    private boolean isContinueSigIn; // 是否连续签到

    public LocalDateTime getSignTime() {
        return signTime;
    }

    public void setSignTime(LocalDateTime signTime) {
        this.signTime = signTime;
    }

    public String getSourceFrom() {
        return sourceFrom;
    }

    public void setSourceFrom(String sourceFrom) {
        this.sourceFrom = sourceFrom == null ? null : sourceFrom.trim();
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public String getUserIcon() {
        return userIcon;
    }

    public void setUserIcon(String userIcon) {
        this.userIcon = userIcon == null ? null : userIcon.trim();
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public LocalDateTime getSignDate() {
        return signDate;
    }

    public void setSignDate(LocalDateTime signDate) {
        this.signDate = signDate;
    }

    public boolean isContinueSigIn() {
        return isContinueSigIn;
    }

    public void setContinueSigIn(boolean continueSigIn) {
        isContinueSigIn = continueSigIn;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("SignIn{");
        sb.append("userId=").append(userId);
        sb.append(", signDate=").append(signDate);
        sb.append(", signTime=").append(signTime);
        sb.append(", sourceFrom='").append(sourceFrom).append('\'');
        sb.append(", userName='").append(userName).append('\'');
        sb.append(", userIcon='").append(userIcon).append('\'');
        sb.append(", isContinueSigIn=").append(isContinueSigIn);
        sb.append('}');
        return sb.toString();
    }
}